// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.util

fun <T> UserDataHolder.removeUserData(key: Key<T>): T? {
  val data = getUserData(key)
  putUserData(key, null)
  return data
}

